<template>
	<div class="container">
		<div class="jx-container">
      <div class="select-type">
        <div class="item table-item">
          <div class="right">
            <div class="item-inline">
              <span>所在地区</span>
              <el-input class="tel-value" v-model="params_list.address" placeholder="请输入所在地区"></el-input>
            </div>
            <div class="item-inline">
              <span>店铺名称</span>
              <el-input class="tel-value" v-model="params_list.name" placeholder="请输入店铺名称"></el-input>
            </div>
            <div class="item-inline">
              <span>客户名称</span>
              <el-input class="tel-value" v-model="params_list.username" placeholder="请输入客户名称"></el-input>
            </div>
            <div class="item-inline">
              <span>供应商名称</span>
              <el-input class="tel-value" v-model="params_list.suppliername" placeholder="请输入供应商名称"></el-input>
            </div>
            <div class="item-inline">
              <span>订单开始时间</span>
              <el-date-picker
                class="tel-value"
                v-model="params_list.start"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择订单开始时间"
                align="right">
              </el-date-picker>
            </div>
            <div class="item-inline">
              <span>订单结束时间</span>
              <el-date-picker
                class="tel-value"
                v-model="params_list.end"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择订单结束时间"
                align="right">
              </el-date-picker>
            </div>
            <div class="item-inline">
              <el-button class="jx-btn" type="primary" @click="search">搜索</el-button>
            </div>
          </div>
        </div>
      </div>
      <div class="jx-table">
        <div class="title">
          <img class="icon" src="/static/img/icon-platform.png"/>
          保险订单列表
          <div class="add-new">
            <el-button class="jx-btn" type="primary" :loading="boo.isExport" @click="exportRow">{{boo.isExport ? '请稍后……' : '导出'}}</el-button>
          </div>
        </div>
        <el-table :data="list" border style="width: 100%" v-loading="boo.loading">
          <el-table-column type="index" label="序列" width="60" align="center">
            <template slot-scope="scope">
              <span>{{(scope.$index + 1) + ((params_list.page - 1) * params_list.size)}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="no" label="保险号" width="150" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="name" label="险种" width="130" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="username" label="客户姓名" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="plate" label="车牌号" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="ly" label="保单来源" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="address" label="所在地区" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="start" label="出单时间" width="150" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="end" label="支付时间" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="price" label="保单费用" align="center" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column prop="status" label="订单状态" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.status == 0">待支付</span>
              <span v-else-if="scope.row.status == 1">已出单</span>
              <span v-else-if="scope.row.status == 2">待出单</span>
            </template>
          </el-table-column>
        </el-table>
        <div v-if="list.length != 0" class="jx-pagination">
           <el-pagination @current-change="pageChange" @size-change="handleSizeChange" :current-page="params_list.page" :page-sizes="[10,50,100]" :page-size="params_list.size" layout="total, sizes, prev, pager, next, jumper"
            :total="list.allRow">
          </el-pagination>
        </div>
      </div>
    </div>
	</div>
</template>

<script>
  import list from 'static/json/order/insurance.json'
	export default {
		data() {
			return {
        boo: {
          loading: false,
          isExport: false,
        },
        other: {
          allRow: 1,
        },
        list: list,
        params_list: {
          page: 1,
          size: 10,
          start: '',
          end: '',
          name: '',
          suppliername: '',
          username: '',
          address: '',
        },
			}
		},
		mounted(){
      let _self = this
      _self.getList()
    },
		methods: {
      getList(){},
      pageChange(val){
        let _self = this
        _self.params_list.page = val
        _self.getList()
      },
      handleSizeChange(val) {
        let _self = this
        _self.params_list.size = val
        _self.getList()
      },
      search(){
        let _self = this
      },
      exportRow(){

      }
    }
	}

</script>
<style scoped lang="sass">
  .select-type .table-item .right span
    width: 92px
</style>
